<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UserRequest extends FormRequest
{

    public function authorize()
    {
        return [
            'name'=> 'required',
            'username'=>'required',
            'type'=>'required',
            'password'=>'required',
            'sex'=>'required'
        ];
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name.required'=>'姓名必填',
            'username.required'=>'用户名必填',
            'type.required'=>'身份名称必填',
            'password.required'=>'密码必填',
            'sex.required'=>'性别必填'
        ];
    }
}
